package com.wn.airplane_mode.activity;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.wn.airplane_mode.R;
/**@author wuning
 * @date 2012年4月5日13:39:44
 * */
public class AirplaneModeToast extends Toast {

	public AirplaneModeToast(Context context,int resId) {
		super(context);
		LayoutInflater inf = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		
    	View layout = inf.inflate(R.layout.toast_view, null);
    	TextView toastText = (TextView) layout.findViewById(R.id.toast_view_text);
    	toastText.setText(resId);
    	              
    	//设置Toast的位置               
    	setGravity(Gravity.CENTER_HORIZONTAL|Gravity.BOTTOM, 0, 20);
    	setDuration(Toast.LENGTH_SHORT);                
    	//让Toast显示为我们自定义的样子               
    	setView(layout);
	}

}
